import { createApp } from 'vue';
import Message from './message.vue';

export function message(title, content, time = 1000) {
    if(message.__timer){
      clearTimeout(message.__timer);
    }
    const app = createApp(Message, { title, content });
    app.mount('#message');
    message.__timer = setTimeout(() => {
        app.unmount();
    }, time);
  }
  